Skip to content

Commit 046c625

Browse files
committed
crypto/openssl: update to 3.5.4
This change includes all necessary changes required to update to OpenSSL 3.5.4. More information about the 3.5.4 release can be found in the relevant release notes (see 8e12a5c for more details). Merge commit '8e12a5c4eb3507846b507d0afe87d115af41df40'
2 parents 4a5a884 + 8e12a5c commit 046c625

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1241
-220
lines changed

crypto/openssl/CHANGES.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,72 @@ OpenSSL Releases
2828
OpenSSL 3.5
2929
-----------
3030

31+
### Changes between 3.5.3 and 3.5.4 [30 Sep 2025]
32+
33+
* Fix Out-of-bounds read & write in RFC 3211 KEK Unwrap
34+
35+
Issue summary: An application trying to decrypt CMS messages encrypted using
36+
password based encryption can trigger an out-of-bounds read and write.
37+
38+
Impact summary: This out-of-bounds read may trigger a crash which leads to
39+
Denial of Service for an application. The out-of-bounds write can cause
40+
a memory corruption which can have various consequences including
41+
a Denial of Service or Execution of attacker-supplied code.
42+
43+
The issue was reported by Stanislav Fort (Aisle Research).
44+
45+
([CVE-2025-9230])
46+
47+
*Viktor Dukhovni*
48+
49+
* Fix Timing side-channel in SM2 algorithm on 64 bit ARM
50+
51+
Issue summary: A timing side-channel which could potentially allow remote
52+
recovery of the private key exists in the SM2 algorithm implementation on
53+
64 bit ARM platforms.
54+
55+
Impact summary: A timing side-channel in SM2 signature computations on
56+
64 bit ARM platforms could allow recovering the private key by an attacker.
57+
58+
The issue was reported by Stanislav Fort (Aisle Research).
59+
60+
([CVE-2025-9231])
61+
62+
*Stanislav Fort and Tomáš Mráz*
63+
64+
* Fix Out-of-bounds read in HTTP client no_proxy handling
65+
66+
Issue summary: An application using the OpenSSL HTTP client API functions
67+
may trigger an out-of-bounds read if the "no_proxy" environment variable is
68+
set and the host portion of the authority component of the HTTP URL is an
69+
IPv6 address.
70+
71+
Impact summary: An out-of-bounds read can trigger a crash which leads to
72+
Denial of Service for an application.
73+
74+
The issue was reported by Stanislav Fort (Aisle Research).
75+
76+
([CVE-2025-9232])
77+
78+
*Stanislav Fort*
79+
80+
* The FIPS provider no longer performs a PCT on key import for ECX keys
81+
(that was introduced in 3.5.2), following the latest update
82+
on that requirement in FIPS 140-3 IG 10.3.A additional comment 1.
83+
84+
*Eugene Syromiatnikov*
85+
86+
* Fixed the length of the ASN.1 sequence for the SM3 digests of RSA-encrypted
87+
signatures.
88+
89+
*Xiao Lou Dong Feng*
90+
91+
* Reverted the synthesised `OPENSSL_VERSION_NUMBER` change for the release
92+
builds, as it broke some exiting applications that relied on the previous
93+
3.x semantics, as documented in `OpenSSL_version(3)`.
94+
95+
*Richard Levitte*
96+
3197
### Changes between 3.5.2 and 3.5.3 [16 Sep 2025]
3298

3399
* Avoided a potential race condition introduced in 3.5.1, where
@@ -21284,6 +21350,9 @@ ndif
2128421350

2128521351
<!-- Links -->
2128621352

21353+
[CVE-2025-9232]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9232
21354+
[CVE-2025-9231]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9231
21355+
[CVE-2025-9230]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9230
2128721356
[CVE-2025-4575]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-4575
2128821357
[CVE-2024-13176]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-13176
2128921358
[CVE-2024-9143]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-9143

crypto/openssl/NEWS.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,46 @@ OpenSSL Releases
2323
OpenSSL 3.5
2424
-----------
2525

26+
### Major changes between OpenSSL 3.5.3 and OpenSSL 3.5.4 [30 Sep 2025]
27+
28+
OpenSSL 3.5.4 is a security patch release. The most severe CVE fixed in this
29+
release is Moderate.
30+
31+
This release incorporates the following bug fixes and mitigations:
32+
33+
* Fix Out-of-bounds read & write in RFC 3211 KEK Unwrap.
34+
([CVE-2025-9230])
35+
36+
* Fix Timing side-channel in SM2 algorithm on 64 bit ARM.
37+
([CVE-2025-9231])
38+
39+
* Fix Out-of-bounds read in HTTP client no_proxy handling.
40+
([CVE-2025-9232])
41+
42+
* Reverted the synthesised `OPENSSL_VERSION_NUMBER` change for the release
43+
builds, as it broke some exiting applications that relied on the previous
44+
3.x semantics, as documented in `OpenSSL_version(3)`.
45+
2646
### Major changes between OpenSSL 3.5.2 and OpenSSL 3.5.3 [16 Sep 2025]
2747

28-
* Added FIPS 140-3 PCT on DH key generation.
48+
OpenSSL 3.5.3 is a bug fix release.
49+
50+
This release incorporates the following bug fixes and mitigations:
2951

30-
*Nikola Pajkovsky*
52+
* Added FIPS 140-3 PCT on DH key generation.
3153

3254
* Fixed the synthesised `OPENSSL_VERSION_NUMBER`.
3355

34-
*Richard Levitte*
56+
* Removed PCT on key import in the FIPS provider as it is not required by
57+
the standard.
3558

3659
### Major changes between OpenSSL 3.5.1 and OpenSSL 3.5.2 [5 Aug 2025]
3760

38-
* none
61+
OpenSSL 3.5.2 is a bug fix release.
62+
63+
This release incorporates the following bug fixes and mitigations:
64+
65+
* The FIPS provider now performs a PCT on key import for RSA, EC and ECX.
3966

4067
### Major changes between OpenSSL 3.5.0 and OpenSSL 3.5.1 [1 Jul 2025]
4168

@@ -45,7 +72,7 @@ release is Low.
4572
This release incorporates the following bug fixes and mitigations:
4673

4774
* Fix x509 application adds trusted use instead of rejected use.
48-
([CVE-2025-4575])
75+
([CVE-2025-4575])
4976

5077
### Major changes between OpenSSL 3.4 and OpenSSL 3.5.0 [8 Apr 2025]
5178

@@ -1913,6 +1940,9 @@ OpenSSL 0.9.x
19131940
* Support for various new platforms
19141941

19151942
<!-- Links -->
1943+
[CVE-2025-9232]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9232
1944+
[CVE-2025-9231]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9231
1945+
[CVE-2025-9230]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9230
19161946
[CVE-2025-4575]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-4575
19171947
[CVE-2024-13176]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-13176
19181948
[CVE-2024-9143]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-9143

crypto/openssl/VERSION.dat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MAJOR=3
22
MINOR=5
3-
PATCH=3
3+
PATCH=4
44
PRE_RELEASE_TAG=
55
BUILD_METADATA=
6-
RELEASE_DATE="16 Sep 2025"
6+
RELEASE_DATE="30 Sep 2025"
77
SHLIB_VERSION=3

crypto/openssl/apps/storeutl.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,22 @@ int storeutl_main(int argc, char *argv[])
331331
static int indent_printf(int indent, BIO *bio, const char *format, ...)
332332
{
333333
va_list args;
334-
int ret;
334+
int ret, vret;
335+
336+
ret = BIO_printf(bio, "%*s", indent, "");
337+
if (ret < 0)
338+
return ret;
335339

336340
va_start(args, format);
341+
vret = BIO_vprintf(bio, format, args);
342+
va_end(args);
337343

338-
ret = BIO_printf(bio, "%*s", indent, "") + BIO_vprintf(bio, format, args);
344+
if (vret < 0)
345+
return vret;
346+
if (vret > INT_MAX - ret)
347+
return INT_MAX;
339348

340-
va_end(args);
341-
return ret;
349+
return ret + vret;
342350
}
343351

344352
static int process(const char *uri, const UI_METHOD *uimeth, PW_CB_DATA *uidata,

crypto/openssl/crypto/bio/bss_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
287287
if (fp == NULL) {
288288
ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
289289
"calling fopen(%s, %s)",
290-
ptr, p);
290+
(const char *)ptr, p);
291291
ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
292292
ret = 0;
293293
break;

crypto/openssl/crypto/ec/ecp_sm2p256.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the Apache License 2.0 (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy

crypto/openssl/crypto/evp/bio_ok.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the Apache License 2.0 (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
@@ -560,7 +560,7 @@ static int block_in(BIO *b)
560560
{
561561
BIO_OK_CTX *ctx;
562562
EVP_MD_CTX *md;
563-
unsigned long tl = 0;
563+
size_t tl = 0;
564564
unsigned char tmp[EVP_MAX_MD_SIZE];
565565
int md_size;
566566

@@ -571,23 +571,26 @@ static int block_in(BIO *b)
571571
goto berr;
572572

573573
assert(sizeof(tl) >= OK_BLOCK_BLOCK); /* always true */
574-
tl = ctx->buf[0];
575-
tl <<= 8;
576-
tl |= ctx->buf[1];
577-
tl <<= 8;
578-
tl |= ctx->buf[2];
579-
tl <<= 8;
580-
tl |= ctx->buf[3];
581-
582-
if (ctx->buf_len < tl + OK_BLOCK_BLOCK + md_size)
574+
tl = ((size_t)ctx->buf[0] << 24)
575+
| ((size_t)ctx->buf[1] << 16)
576+
| ((size_t)ctx->buf[2] << 8)
577+
| ((size_t)ctx->buf[3]);
578+
579+
if (tl > OK_BLOCK_SIZE)
580+
goto berr;
581+
582+
if (tl > SIZE_MAX - OK_BLOCK_BLOCK - (size_t)md_size)
583+
goto berr;
584+
585+
if (ctx->buf_len < tl + OK_BLOCK_BLOCK + (size_t)md_size)
583586
return 1;
584587

585588
if (!EVP_DigestUpdate(md,
586589
(unsigned char *)&(ctx->buf[OK_BLOCK_BLOCK]), tl))
587590
goto berr;
588591
if (!EVP_DigestFinal_ex(md, tmp, NULL))
589592
goto berr;
590-
if (memcmp(&(ctx->buf[tl + OK_BLOCK_BLOCK]), tmp, md_size) == 0) {
593+
if (memcmp(&(ctx->buf[tl + OK_BLOCK_BLOCK]), tmp, (size_t)md_size) == 0) {
591594
/* there might be parts from next block lurking around ! */
592595
ctx->buf_off_save = tl + OK_BLOCK_BLOCK + md_size;
593596
ctx->buf_len_save = ctx->buf_len;

crypto/openssl/crypto/evp/ctrl_params_translate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ static int fix_rsa_padding_mode(enum state state,
13561356
if (i == OSSL_NELEM(str_value_map)) {
13571357
ERR_raise_data(ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE,
13581358
"[action:%d, state:%d] padding name %s",
1359-
ctx->action_type, state, ctx->p1);
1359+
ctx->action_type, state, (const char *)ctx->p2);
13601360
ctx->p1 = ret = -2;
13611361
} else if (state == POST_CTRL_TO_PARAMS) {
13621362
/* EVP_PKEY_CTRL_GET_RSA_PADDING weirdness explained further up */

crypto/openssl/crypto/evp/p_lib.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,15 +1146,14 @@ int EVP_PKEY_can_sign(const EVP_PKEY *pkey)
11461146
} else {
11471147
const OSSL_PROVIDER *prov = EVP_KEYMGMT_get0_provider(pkey->keymgmt);
11481148
OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
1149-
const char *supported_sig =
1150-
pkey->keymgmt->query_operation_name != NULL
1151-
? pkey->keymgmt->query_operation_name(OSSL_OP_SIGNATURE)
1152-
: EVP_KEYMGMT_get0_name(pkey->keymgmt);
1153-
EVP_SIGNATURE *signature = NULL;
1154-
1155-
signature = EVP_SIGNATURE_fetch(libctx, supported_sig, NULL);
1156-
if (signature != NULL) {
1157-
EVP_SIGNATURE_free(signature);
1149+
EVP_SIGNATURE *sig;
1150+
const char *name;
1151+
1152+
name = evp_keymgmt_util_query_operation_name(pkey->keymgmt,
1153+
OSSL_OP_SIGNATURE);
1154+
sig = EVP_SIGNATURE_fetch(libctx, name, NULL);
1155+
if (sig != NULL) {
1156+
EVP_SIGNATURE_free(sig);
11581157
return 1;
11591158
}
11601159
}

crypto/openssl/crypto/info.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
2+
* Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
33
*
44
* Licensed under the Apache License 2.0 (the "License"). You may not use
55
* this file except in compliance with the License. You can obtain a copy
@@ -23,6 +23,9 @@
2323
#if defined(__arm__) || defined(__arm) || defined(__aarch64__)
2424
# include "arm_arch.h"
2525
# define CPU_INFO_STR_LEN 128
26+
#elif defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC)
27+
# include "crypto/ppc_arch.h"
28+
# define CPU_INFO_STR_LEN 128
2629
#elif defined(__s390__) || defined(__s390x__)
2730
# include "s390x_arch.h"
2831
# define CPU_INFO_STR_LEN 2048
@@ -77,6 +80,15 @@ DEFINE_RUN_ONCE_STATIC(init_info_strings)
7780
BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
7881
sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
7982
" env:%s", env);
83+
# elif defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC)
84+
const char *env;
85+
86+
BIO_snprintf(ossl_cpu_info_str, sizeof(ossl_cpu_info_str),
87+
CPUINFO_PREFIX "OPENSSL_ppccap=0x%x", OPENSSL_ppccap_P);
88+
if ((env = getenv("OPENSSL_ppccap")) != NULL)
89+
BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
90+
sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
91+
" env:%s", env);
8092
# elif defined(__s390__) || defined(__s390x__)
8193
const char *env;
8294

0 commit comments

Comments
 (0)